<script >
 function insertAtCursor(myField, myValue) {

				//IE 浏览器
				 if (document.selection) {
					 myField.focus();
					 sel = document.selection.createRange();
					 sel.text = myValue;
					 sel.select();
				 }
 
				 //FireFox、Chrome等
				 else if (myField.selectionStart || myField.selectionStart == '0') {
					 var startPos = myField.selectionStart;
					 var endPos = myField.selectionEnd;
 
					 // 保存滚动条
					 var restoreTop = myField.scrollTop;
					 myField.value = myField.value.substring(0, startPos) + myValue + myField.value.substring(endPos, myField.value.length);
					 
					 if (restoreTop > 0) {
						myField.scrollTop = restoreTop;
					 }
					 
					 myField.focus();
					 myField.selectionStart = startPos + myValue.length;
					 myField.selectionEnd = startPos + myValue.length;
				 } else {
					 myField.value += myValue;
					 myField.focus();
				 }
			 }
</script>
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">标签:</label>
		<input id="adddiqu" type="hidden" value="【diqu】" />
		<input id="addcitou" type="hidden" value="【citou】" />
		<input id="addzhuci" type="hidden" value="【zhuci】" />
		<input id="addciwei" type="hidden" value="【ciwei】" />
		<input id="addbiaoti" type="hidden" value="【biaoti】" />
		<span onclick="insertAtCursor(document.getElementById('c-content'),document.getElementById('adddiqu').value)" style="margin-left:14px;" class="btn btn-success btn-add" >【地区】</span>
		<span onclick="insertAtCursor(document.getElementById('c-content'),document.getElementById('addcitou').value)" style="margin-left:14px;" class="btn btn-success btn-add" >【词头】</span>
		<span onclick="insertAtCursor(document.getElementById('c-content'),document.getElementById('addzhuci').value)" style="margin-left:14px;" class="btn btn-success btn-add" >【主词】</span>
		<span onclick="insertAtCursor(document.getElementById('c-content'),document.getElementById('addciwei').value)" style="margin-left:14px;" class="btn btn-success btn-add" >【词尾】</span>
		<span onclick="insertAtCursor(document.getElementById('c-content'),document.getElementById('addbiaoti').value)" style="margin-left:14px;" class="btn btn-success btn-add" >【标题】</span>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-content" data-rule="required" class="form-control form-control" rows="15" name="row[content]" cols="50">{$row.content}</textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Addtime')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-addtime" data-rule="required" class="form-control datetimepicker form-control" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[addtime]" type="text" value="{$row.addtime|datetime}">
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
